package com.derschmale.wick3d.core.utils
{
	public class Colour
	{
		public var r : Number;
		public var g : Number;
		public var b : Number;
		
		public function Colour(r : Number, g : Number, b : Number)
		{
			this.r = r;
			this.g = g;
			this.b = b;
		}
		
		public function toHex() : int
		{
			return ((r*0xff) << 16) + ((g*0xff) << 8) + b*0xff;
		}
		
		public function clip() : void
		{
			if (r > 1) r = 1;
			if (g > 1) g = 1;
			if (b > 1) b = 1;
		}
		
		public function toString():String
		{
			return "[Object Colour(r="+r+", g="+g+", b="+b+")]";
		}
	}
}